$(function(){
	 var allorder = echarts.init(document.getElementById('allorder'));
	var allmoneny = echarts.init(document.getElementById('allmoneny'));
	var alltime = echarts.init(document.getElementById('alltime'));
option = {
    tooltip: {
        trigger: 'item',
        formatter: "{a} <br/>{b}: {c} ({d}%)"
    },
    legend: {
        orient: 'vertical',
        x: 'left',
        data : ['个人订单数', '企业订单数', '单位订单数']
    },
    series: [
        {
            name:'订单数量',
            type:'pie',
            radius: ['50%', '70%'],
            avoidLabelOverlap: false,
            label: {
                normal: {
                    show: false,
                    position: 'center'
                },
                emphasis: {
                    show: true,
                    textStyle: {
                        fontSize: '30',
                        fontWeight: 'bold'
                    }
                }
            },
            labelLine: {
                normal: {
                    show: false
                }
            },
            data:[
                {value:335, name:'个人订单数'},
                {value:310, name:'企业订单数'},
                {value:234, name:'单位订单数'}
            ]
        }
    ]
};

option1 = {
   tooltip: {
        trigger: 'item',
        formatter: "{a} <br/>{b}: {c} ({d}%)"
    },
    legend: {
        orient: 'vertical',
        x: 'left',
        data : ['个人订单金额', '企业订单金额', '单位订单金额']
    },
    series: [
        {
            name:'金额',
            type:'pie',
            radius: ['50%', '70%'],
            avoidLabelOverlap: false,
            label: {
                normal: {
                    show: false,
                    position: 'center'
                },
                emphasis: {
                    show: true,
                    textStyle: {
                        fontSize: '30',
                        fontWeight: 'bold'
                    }
                }
            },
            labelLine: {
                normal: {
                    show: false
                }
            },
            data:[
                {value:200, name:'个人订单金额'},
                {value:510, name:'企业订单金额'},
                {value:434, name:'单位订单金额'}
            ]
        }
    ]
};
option2 = {
    tooltip: {
        trigger: 'item',
        formatter: "{a} <br/>{b}: {c} ({d}%)"
    },
    legend: {
        orient: 'vertical',
        x: 'left',
        data : ['个人订单耗时', '企业订单耗时', '单位订单耗时']
    },
    series: [
        {
            name:'耗时',
            type:'pie',
            radius: ['50%', '70%'],
            avoidLabelOverlap: false,
            label: {
                normal: {
                    show: false,
                    position: 'center'
                },
                emphasis: {
                    show: true,
                    textStyle: {
                        fontSize: '30',
                        fontWeight: 'bold'
                    }
                }
            },
            labelLine: {
                normal: {
                    show: false
                }
            },
            data:[
                {value:200, name:'个人订单耗时'},
                {value:510, name:'企业订单耗时'},
                {value:434, name:'单位订单耗时'}
            ]
        }
    ]
};

  // 使用刚指定的配置项和数据显示图表。
        allorder.setOption(option);
        allmoneny.setOption(option1);
        alltime.setOption(option2);
        $(function(){
	$('.report-classify>button').on('click',function(){
		$(this).removeClass('am-btn-secondary')
		$(this).addClass('am-btn-success')
		$(this).siblings().removeClass('am-btn-success')
		$(this).siblings().addClass('am-btn-secondary')
	})
})

})
